import {createApp} from 'vue'
import {createPinia} from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'

import App from './App.vue'
import router from './router'
import '@/style/modules/reset.scss'
import "@/style/modules/common.scss";
// import "@/style/modules/element.scss";
import "animate.css/animate.min.css";
import 'element-plus/dist/index.css'
import '@/utils/elTable'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import hasPermi from '@/directives/permission/hasPermi'
import hasRole from '@/directives/permission/hasRole'

const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)

const app: App<Element> = createApp(App)

app.config.globalProperties.$icons = []

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.config.globalProperties.$icons.push(key)
    app.component(key, component)
}
app.use(pinia)
app.use(router)
app.use(hasPermi)
app.use(hasRole)
app.mount('#app')
